package com.gpnu7_412.yanzhi.dto;

import com.gpnu7_412.yanzhi.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 简明用户DTO
 * 用于在列表界面展示用户的对象
 * @author ZZH
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ConciseUserDto {
    private Integer userId;
    private String userName;
    private String avatar;

    public ConciseUserDto(User user) {
        userId = user.getUserId();
        userName = user.getUserName();
        avatar = user.getAvatar();
    }
}
